package com.aaa.tars.controller;

import com.aaa.tars.entity.LoginLog;
import com.aaa.tars.service.LoginLogService;
import com.aaa.tars.util.Result;
import com.aaa.tars.util.ResultUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @FileName: LoginlogController
 * @Description:
 * @Author: xm
 * @CreateTime: 2025/9/22 20:15
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("loginLog")
public class LoginLogController {
    @Resource
    private LoginLogService loginLogService;

    //添加操作日志
    @PostMapping("add")
    public Result add(@RequestBody LoginLog loginLog) {
        return ResultUtil.success(loginLogService.add(loginLog));
    }

    //查询每月操作日志Echarts图,
    @GetMapping("queryEchartsDataByYearMonth")
    public Result queryEchartsDataByYearMonth(String yearMonth) {
        return ResultUtil.success(loginLogService.queryEchartsDataByYearMonth(yearMonth));
    }
}
